package com.tfr.webflux.utils;

import com.tfr.webflux.exceptions.CheckException;

import java.util.stream.Stream;

/**
 * @description:
 * @author: rain
 * @date: Created in 2021/12/8 22:01
 * @version:
 * @modified By:
 */
public class CheckUtil {

  private static final String[] UN_NAME = {"admin", "sys"};

  public static void checkName(String value) {
    Stream.of(UN_NAME)
        .filter(name -> name.equalsIgnoreCase(value))
        .findAny()
        .ifPresent(
            name -> {
              throw new CheckException("name", value);
            });
  }
}
